package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntity
import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "base_message")
@TableName("base_message")
@ApiModel(value = "信息")
data class Message(

        @ApiModelProperty("信息类型 1.企业消息")
        var type: Int? = null,

        @ApiModelProperty("企业id")
        var enterpriseId: String? = null,

        @ApiModelProperty("标题")
        var title: String? = null,

        @ApiModelProperty("接收消息用户的id")
        var receiveUserId: String? = null,

        @ApiModelProperty("内容")
        var content: String? = null,

        @ApiModelProperty("是否已读")
        var isRead: Boolean? = false

) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object {
        private const val serialVersionUID = 1L
    }
}